<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<title><?php echo ($name); ?></title>
<script src="__APP__/statics/jquery-1.9.1.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="__APP__/statics/css/jNotify.jquery.css" />
<script type="text/javascript" src="__APP__/statics/jNotify.jquery.js"></script>
<style>
 body{font-family:"微软雅黑";font-size:12px;color:#666666;background-color:#F9F9F6}
 *{margin: 0;} 
 a{text-decoration:none}
 img{border:0px}
.cat{background-color:#F9F9F6;margin-left:10px;z-index:0;}
.cat_list:hover{background-color:#fff;}
.title{background:url("__APP__/statics/tbg.gif");font-weight:bold}

#save{text-align:center;border:0;width:100%;height:40px;background-color:#fff;position:fixed;left:0px;bottom:0px;z-index:999;border:1px solid #DFDFDF;background-color:#DFDFDF;padding:5px;height:20px}
</style>


<div style="width:845px;float:left;margin-left:10px">
<textarea name="tpl" cols="100" rows="25"><?php echo ($tpl["tpl"]); ?></textarea>
</div>
<div style="width:100px;float:left;margin-left:10px">
<br>
<input type="button" name="save" style="width:100px;padding:3px" value="保存修改"><br><br>
<a href="#view2">查看效果</a>
</div>
<input type="text" id="type" value="<?php echo ($tpl["type"]); ?>" style="display:none">
<br>
<a name="view2" id="my"> &nbsp; </a>
<div id="view" style="border:2px solid #dedede;width:930px;padding:5px;margin:0 auto;">
预览效果:<br>
<?php echo ($tpl["tpl"]); ?>
</div>



<script src="__APP__/statics/webox/webox.js"></script>
<link href="__APP__/statics/webox/jquery-webox.css" rel="stylesheet" type="text/css">
<script>

$('[name=save]').click(function(){
    var type=$("#type").val();
	var tpl=$("[name=tpl]").html();
	$.ajax({
	      type:"POST",
		  url:"__URL__/email_tpl/?action=save",
		  dataType:"json",
		  data:{'type':type,'tpl':tpl},
		  success:function(data){
		  location.reload();
		  }
	})

});
</script>